package com.nandi.deviceinstall.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment


abstract class BaseFragment : Fragment() {


    protected abstract val layoutId: Int

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val view = inflater.inflate(this.layoutId, container, false)
        initView(view)
        return view
    }

    override fun onDestroyView() {
        super.onDestroyView()
    }

    /**
     * 初始化视图
     *
     * @param view
     */
    protected abstract fun initView(view: View)
}
